package com.cgycms.webdeploy.filter;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName : LoginConfig
 * @Description : 登录配置释放配置
 * @Author : 王力超
 * @Date: 2020-11-10 10:33
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration registration = registry.addInterceptor(new LoginInterceptor());
        registration.addPathPatterns("/**");
        registration.excludePathPatterns(
                "/login",
                "/loginOut",
                "/static/*",
                "/lib/**",
                "/api/**",
                "/css/**",
                "/images/**",
                "/js/**",
                "/captcha/**"
        );
    }
}
